package com.broadengate.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.actions.DispatchAction;

public class AdminExitAction extends DispatchAction {

	/******
	 * 管理员页面中所有退出按钮实现退出功能
	 * 核心功能删除session中的内容
	 * @param mapping
	 * @param form
	 * @param request
	 * @param response
	 * @return ActionForward 对象
	 */
	public ActionForward exit(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response){
		
		HttpSession session=request.getSession();
			   session.removeAttribute("adminName");
			   return mapping.findForward("success");
	
	}
}
